<?php

require_once('utils.php');

if (!isset($_GET['industry']) || !property_exists($lang->home, $_GET['industry'])) 
	header('Location: tablet.php');

require_once('Mobile_Detect.php');
$detect = new Mobile_Detect();

?>
<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><?php printf("%s - %s", $lang->home->title, $lang->home->$_GET['industry']->h2) ?></title>
    <meta name="description" content="<?php echo($lang->home->description) ?>" />
    <meta property="fb:app_id" content="<?php echo($lang->home->fbapp_id) ?>" /> 
    <meta property="og:type" content="website" /> 
    <meta property="og:title" content="<?php echo($lang->home->ogtitle) ?>" /> 
   	<meta property="og:image" content="<?php echo(hostname().$lang->home->ogimage) ?>" /> 
	<meta property="og:description" content="<?php echo($lang->home->ogdescription) ?>" /> 
    <meta property="og:url" content="<?php echo(full_url()) ?>">
    
    <link rel="stylesheet" href="css/fonts/fonts.css" />
    <link rel="stylesheet" href="css/jquery.mobile.structure-1.0.1.min.css" />
    <link rel="stylesheet" href="css/tablet.css" />
    
</head>

<body class="tablet">
    <div data-role="page" id="industry" data-dom-cache="true">
        <div data-role="content">
            <div class="ui-grid-a">
                <div class="ui-block-a">
					<div class="industry-tile">
						<img src="../../../img/icons/grey-<?php echo($_GET['industry']) ?>.png" alt="" class="industry-icon" />
					</div>
                    <h1><span><?php echo($lang->home->$_GET['industry']->h2) ?></span></h1>
					<div class="copy">
						<h3><?php echo($lang->home->$_GET['industry']->h3) ?></h3>
						<?php echo(str_replace("<br/>", " ", $lang->home->$_GET['industry']->copy)) ?>
						<?php echo(replaceIndustryFirms($lang->tablet->industry->generic)) ?>
						<a href="tablet-demo.php?industry=telcoinfo&slide=1" data-role="button" data-inline="true" class="take-a-tour" data-transition="pop"><?php echo($lang->buttons->takeatour) ?></a><br/>
						<a class="talk-to-us" data-role="button" data-transition="fade" href="iframe.php" data-inline="true" data-rel="dialog"><?php echo($lang->buttons->talktous) ?></a>
					</div>
                </div>
                <div class="ui-block-b">
                    <div class="tiles">
                        <?php
                        $tileArray = array(
                        	'0' => array('e', 'b', 'b', 'e', 'b'),
                        	'1' => array('e', 'm', 'm', 'e', 'b'),
                        	'2' => array('b', 'b', 'b', 'b', 'b'),
                        	'3' => array('b', 'b', 'b', 'b', 'b'),
                        	'4' => array('b', 'b', 'b', 'b', 'b'),
                        	'5' => array('b', 'b', 'm', 'b', 'm'),
                        	'6' => array('b', 'b', 'e', 'b', 'e')
                        	);
                        for ($i = 0; $i < count($tileArray); $i++) 
                        {
                        	echo('<div class="Row">');
                        	for ($j=0; $j < count($tileArray[$i]); $j++) 
                        	{
                        		switch($tileArray[$i][$j]) 
                        		{
                        			case 'e':
                        				echo ('<div class="Tile Empty"></div>');
                        				break;
                        			case 'b':
                        				echo ('<div class="Tile Blank"></div>');
                        				break;
                        			case 'm':
                        				printf('<div class="Tile Map" style="background-image:url(../img/tablet/tiles/industry/%s%s.png);"></div>', $i, $j);
                        				break;
                        		}
                        	}
                        	echo('</div>');
                        }
                        ?>
						<a href="tablet.php" data-role="button" data-inline="true" class="home">
							<img src="../img/tablet/tiles/back.png" />
						</a>
						<a href="tablet-demo.php?industry=<?php echo($_GET['industry']) ?>&slide=1" data-role="button" data-inline="true" class="demo-cta" data-rel="page" data-transition="pop">
							<img src="../img/tablet/demoMap-<?php echo($_GET['industry']) ?>.jpg" class="demo-img"/>
							<div class="demo-shot"></div>
							<img src="../img/tablet/play-button.png" class="play" />
						</a>
                    </div>
                </div>
            </div>
        </div>
        <div data-theme="" data-role="footer">
            <div class="divider"></div>     
            <div class="social">
                <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style addthis_20x20_style">
                <a class="addthis_button_email" addthis:title="<?php echo($lang->sharing->facebook->title) ?>" addthis:description="<?php echo($lang->sharing->facebook->description) ?>" addthis:email_template="discovermapsforbusiness"><img src="img/tablet/email.png" /></a>
                <a class="addthis_button_twitter" addthis:title="<?php echo($lang->sharing->twitter) ?>"><img src="img/tablet/twitter.png" /></a>
                </div>
                <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e5affd91537e09b"></script>
                <!-- AddThis Button END -->
                <div class="plusone"><div class="g-plusone" data-size="standard" data-href="<?php echo(hostname())?>/index.php"></div>

                    <!-- Place this render call where appropriate -->
                    <script type="text/javascript">
                      (function() {
                        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                        po.src = 'https://apis.google.com/js/plusone.js';
                        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                      })();
                    </script>
                </div>
            </div>
            <a data-role="button" data-transition="none" href="<?php $_SERVER["DOCUMENT_ROOT"] ?>/">
                <img src="img/google-logo.png" alt="<?php echo($lang->home->footer->googlelogoalt) ?>" class="logo" />
            </a>
        </div>
    </div>
    
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>        window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
    <script src="js/libs/raphael-min.js"></script>
    <script src="//www.google.com/jsapi"></script>
    <script src="js/plugins.js"></script>
    <script src="js/tablet.js"></script>
    <script src="js/libs/jquery.mobile-1.0.1.min.js"></script>
    <?php include_once($_SERVER['DOCUMENT_ROOT']."/includes/ga.php") ?>
</body>
</html>
